package com.fnzn.entranceGuard.rest;

import com.fnzn.entranceGuard.mapper.GuardQrInfoMapper;
import com.fnzn.entranceGuard.service.AuthGuardService;
import com.fnzn.entranceGuard.util.DateTools;
import com.github.pig.common.util.R;
import com.github.pig.common.web.BaseController;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

/**
 * Created by sxf 2018/05/23
 */
@Controller
@Slf4j
@RequestMapping("/guard")
public class GuardRest extends BaseController {

    @Value("${qr.interval}")
    private Integer interval;

    @Autowired
    private GuardQrInfoMapper infoMapper;
    @Autowired
    private AuthGuardService infoService;


    @RequestMapping(value = "/index", method = RequestMethod.GET)
    public String index() {
        return "index";
    }

    public static void main(String[] args) {
        String d = DateTools.getCurrentSysData(DateTools.FULL_FORMAT);
        System.out.println(d);
        try {
            Thread.sleep(6000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        String d1 = DateTools.getCurrentSysData(DateTools.FULL_FORMAT);
        System.out.println(d1);
        System.out.println(DateTools.datePoorDiffSecond(d, d1));
    }

}
